import pandas as pd

def convert_zc_excel_to_csv(excel_file_path, sheet_name, output_csv_path):
    """
    将足彩的Excel文件转换为特定格式的CSV文件
    :param excel_file_path: Excel文件路径
    :param sheet_name: 需要转换的Sheet名称
    :param output_csv_path: 输出的CSV文件路径
    """
    df = pd.read_excel(excel_file_path, sheet_name=sheet_name)
    
    # 假设足彩数据在指定列，需要提取和格式化
    df = df[['日期', '主队', '客队', '比分', '胜负']]
    df.columns = ['date', 'home_team', 'away_team', 'score', 'result']
    
    df.to_csv(output_csv_path, index=False)
    print(f"足彩数据已转换为CSV格式，保存到 {output_csv_path}")

if __name__ == "__main__":
    excel_file_path = "data/raw/zc/lottery_data.xlsx"
    sheet_name = "Sheet1"
    output_csv_path = "data/raw/zc/lottery_data.csv"
    
    convert_zc_excel_to_csv(excel_file_path, sheet_name, output_csv_path)